package st.business.tepth.business.history.detail;

import st.business.tepth.base.OnDataConvertListener;
import st.business.tepth.business.bean.HistoryDetailBean;

/**
 * Author: shadow
 * Email:  1025431817@qq.com
 * Time:   2019-03-04 10:35
 */

public class HistoryDetailPresenter extends HistoryDetailContract.Presenter {
    private final HistoryDetailContract.View mView;
    private final HistoryDetailContract.Model mModel;

    public HistoryDetailPresenter(HistoryDetailContract.View view) {
        mView = view;
        mModel = new HistoryDetailModel();
    }

    @Override
    void getHistoryData(String token, int id) {
        addDisposable(mModel.getHistoryData(token, id, new OnDataConvertListener<HistoryDetailBean>() {
            @Override
            public void convert(HistoryDetailBean historyDetailBean) {
                mView.showHistoryData(historyDetailBean);
            }

            @Override
            public void error(int code, String msg) {

            }
        }));
    }
}
